<?php
namespace app\model;
use app\BaseModel;
use app\console\model\AdminRole;
use think\facade\Db;
use think\facade\Request;
use think\model\concern\SoftDelete;

class Message extends BaseModel
{

    use SoftDelete;
    protected $deleteTime = 'delete_time';
    protected $defaultSoftDelete = '0000-00-00 00:00:00';
    protected $hidden = ['update_time','delete_time','sort','status'];


    protected static function onAfterInsert($data)
    {

        $member = Member::select();
        foreach ($member as $v) {
            MemberMessage::create(['member_id' => $v['id'], 'title' => $data['title'], 'content' => $data['content']]);
        }

    }






}